<template>
	<view class="page">
		<view class="card-box">
			<view class="from-box">
				<view class="title">
					省市区
				</view>
				<view class="from-value option" @click="selectedCity">
					<view class="input">
						北京市，东城区
					</view>
					<image class="right-icon" src="/static/image/push_icon.png" mode="aspectFit"></image>
				</view>
			</view>
			<view class="from-box">
				<view class="title">
					详细地址
				</view>
				<view class="from-value">					
					<input class="input" type="text" value="北京市东城区" />
				</view>
			</view>
			<view class="from-box">
				<view class="title">
					联系人
				</view>
				<view class="from-value">					
					<input class="input" type="text" value="案说法是" />
				</view>
			</view>
			<view class="from-box">
				<view class="title">
					联系电话
				</view>
				<view class="from-value">					
					<input class="input" maxlength="12" type="number" value="18784248" />
				</view>
			</view>
		</view>
		<view class="button">确定</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		onLoad(option) {
			if(option.type && option.addresstype){
				let text = '';
				if(option.type == 'edit'){
					text = '编辑'
				}else if(option.type == 'add'){
					text = '新增'
				}
				if(option.addresstype == 'send'){
					text = text + '发货地址'
				}else if(option.addresstype == 'receive'){
					text = text + '收货地址'
				}
				uni.setNavigationBarTitle({
					title: text
				});
			}
		},
		methods: {
			selectedCity:function(){
				uni.navigateTo({
					url: '/pages/user/address/city'
				});
			},
		}
	}
</script>

<style lang="scss" scoped>
	.page{
		background-color: #f6f6f6;
		min-height: 100vh;
		.card-box{
			background-color: white;
			width: calc(100% - 40rpx);
			margin: 0 20rpx;
			padding: 40rpx 0;
			.from-box{
				display: flex;
				font-size: 28rpx;
				margin-bottom: 20rpx;
				.title{
					line-height: 70rpx;
					text-align: right;
					width: 30%;
				}
				.from-value{
					margin-left: 20rpx;
					border:1px solid #dfdfdf;
					height: 70rpx;
					width: calc(70% - 50rpx);
					box-sizing: border-box;
					padding: 0 10rpx;
					border-radius:4rpx;
					.input{
						height: 70rpx;
						line-height: 70rpx;
					}
				}
				.option{
					position: relative;
					.right-icon{
						position: absolute;
						top:15rpx;
						right:10rpx;
						width: 40rpx;
						height: 40rpx;
					}
				}
			}
		}
		.button{
			text-align: center;
			line-height: 80rpx;
			background-color: #2fa777;
			color:white;
			font-size: 28rpx;
			position: fixed;
			bottom:calc(20rpx + constant(safe-area-inset-bottom));
			bottom:calc(20rpx + env(safe-area-inset-bottom));
			left: 20rpx;
			width:calc(100% - 40rpx);
			border-radius: 10rpx;
		}
	}
</style>
